﻿namespace Digitalmes.Domain.Mes;

/// <summary>
/// 工位信息。
/// </summary>
[SugarTable("md_station", "工位信息表")]
public class MdStation : EntityBase
{
    /// <summary>
    /// 工位编号
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "工位编号", Length = 32)]
    public string? OpCode { get; init; }

    /// <summary>
    /// 工位名称
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "工位名称", Length = 32)]
    public string? OpName { get; set; }

    /// <summary>
    /// 所属产线 Id
    /// </summary>
    [SugarColumn(ColumnDescription = "所属产线Id")]
    public long LineId { get; set; }

    [Navigate(NavigateType.OneToOne, nameof(LineId))]
    public MdLine? Line { get; set; }

    /// <summary>
    /// 产线编号
    /// </summary>
    [NotNull]
    [SugarColumn(ColumnDescription = "产线编号", Length = 32)]
    public string? LineCode { get; set; }

    /// <summary>
    /// 排序
    /// </summary>
    [SugarColumn(ColumnDescription = "排序")]
    public int Sort {  get; set; }

    /// <summary>
    /// 工位属性（人工/设备）
    /// </summary>
    [SugarColumn(ColumnDescription = "工位属性")]
    public OpAttrEnum Attr { get; set; }

    /// <summary>
    /// 工位归属（线上/线外）
    /// </summary>
    [SugarColumn(ColumnDescription = "工位类别")]
    public OpOwnerEnum Owner { get; set; }

    /// <summary>
    /// 工位分类（装配/检测/返工/NG口）
    /// </summary>
    [SugarColumn(ColumnDescription = "工位分类")]
    public OpClassifyEnum Classify { get; set; }
}
